<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>recycle Management</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/type.css" />
<script type="text/javascript" src="__PUBLIC__/js/admin.js"></script>


<script>
$(function(){
	$("#categorysel").change(function(){
		window.location.href = "__ACTION__/GoodcategoryId/" + $("#categorysel").val();
	});
});
</script>

<style>
/*分页列表*/
.pagelist {
	text-align: center;
	margin-top: 10px;
}

.pagelist a {
	margin: 0 5px;
	border: 1px solid #ddd;
	padding: 1px 4px;
	color: #666;
}

.pagelist a:hover {
	text-decoration: none;
}

.pagelist span {
	padding: 1px 4px;
}
</style>

</head>
<body>
<br>
<br>
<form method="post">
<table class="classify_table1">
	<tr>
		<td><span class="classify_table_title">下架商品</span> <span
			class="classify_table_button"> <input type="button"
			id="delselect_btn" value="删除"> </span> <span
			class="classify_table_button"> <input type="button"
			id="huanyuanselect_btn" value="还原"> </span>
		</span></td>
	</tr>
	<tr>
		<td>
		<table class="classify_table2">
			<tr>
				<td class="classify_thead_checkbox"><input type="checkbox"
					onclick="DoCheck()" name="allChecked" id="allChecked"></td>
				<td class="classify_thead_title">商品编号</td>
				<td class="classify_thead_title">商品名称</td>
				<td class="classify_thead_title">商品颜色</td>
				<td class="classify_thead_title">商品型号</td>
				<td class="classify_thead_title ">分类 <select id="categorysel"
					name="GoodcategoryId">
					<option value="0">全部</option>
					<foreach name="goodcategory" item="v">
					<option value="{$v.GoodcategoryId}"<eq
						name="v.GoodcategoryId" value="$GoodcategoryId">selected</eq>
					>{:str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;',$v['deep']).$v['CategoryName']}</option>
					</foreach>
				</select></td>
				<td class="classify_thead_title " colspan="2">修改</td>
			</tr>
			<foreach name="goods.list" item="v">
			<tr>
				<td class="classify_thead_checkbox"><input type="checkbox"
					name="goodids[]" class="choose" value="<?php echo
				$v['GoodId']."@@@".$v['Color']."@@@".$v['Version']?>"></td>
				<td class="classify_tbody">{$v.GoodId}</td>
				<td class="classify_tbody">{$v.GoodName}</td>
				<td class="classify_tbody">{$v.Color}</td>
				<td class="classify_tbody">{$v.Version}</td>
				<td class="classify_tbody">{$v.CategoryName}</td>
				<td>
				<button><a href="__CONTROLLER__/modifyGoods/goodids/<?php
				echo $v['GoodId']."@@@".$v['Color']."@@@".$v['Version']?>">编辑</a></button>
				</td>
				<td>
				<button><a href="__CONTROLLER__/deleteGoods/GoodcategoryId/{$GoodcategoryId}/goodids/<?php
				echo $v['GoodId']."@@@".$v['Color']."@@@".$v['Version']?>" onClick="return confirm('确定删除?');">删除</a></button>
				</td>
			</tr>
			</foreach>

		</table>
		</td>
	</tr>
	<tr>
		<td>
		<div class="pagelist">{$goods.page}</div>
		</td>
	</tr>
</table>

</form>

<script>
//批量下架时使用



$('#delselect_btn').click(function(){
	if($(".choose:checked").length<=0){
		alert("勾选至少一个属性复选框，才能进行本操作！");
		retrun;}
	if(confirm('操作后将无法找回这些商品，确定删除?'))
	{
		$('form').attr('action','__CONTROLLER__/delSelect/GoodcategoryId/{$GoodcategoryId}');
		$('form').submit();
	}

});

$('#huanyuanselect_btn').click(function(){
	if($(".choose:checked").length<=0){
		alert("勾选至少一个属性复选框，才能进行本操作！");
		retrun;}
	if(confirm('确定还原(上架)这些商品?'))
	{
		$('form').attr('action','__CONTROLLER__/huanyuanselect/GoodcategoryId/{$GoodcategoryId}');
		$('form').submit();
	}

});

</script>
</body>
</html>